/* tech-style.css */
@import 'https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap';

/* ===== 全局变量 ===== */
:root {
    /* 主色调 */
    --primary-color: #4a6bff;
    --primary-dark: #3a5bef;
    --accent-color: #ff6b6b;

    /* 背景色 */
    --background-color: #0a0f1a;
    --secondary-bg: #131a26;
    --card-bg: rgba(22, 25, 49, 0.8);

    /* 文本色 */
    --text-color: #e0e0e0;
    --text-light: #b3b3b3;
    --text-lighter: #858585;

    /* 边框 */
    --border-color: rgba(74, 107, 255, 0.2);
    --border-dark: rgba(38, 50, 72, 0.7);

    /* 阴影 */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);

    /* 其他 */
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --border-radius: 12px;
    --success-color: #28a745;
    --danger-color: #dc3545;
}

/* ===== 基础样式 ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 主容器 */
.main-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 科技感背景特效 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
            radial-gradient(circle at 20% 30%, rgba(74, 107, 255, 0.15) 0%, transparent 30%),
            radial-gradient(circle at 80% 70%, rgba(255, 107, 107, 0.15) 0%, transparent 30%);
    z-index: -1;
}

/* ===== 排版 ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: white;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-color);
}

/* ===== 导航栏 ===== */
.navbar {
    background: rgba(16, 18, 37, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.navbar-nav a {
    color: var(--text-light);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: white;
}

.navbar-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: var(--transition);
}

.navbar-nav a:hover::after,
.navbar-nav a.active::after {
    width: 100%;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-sm);
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:hover::before {
    opacity: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #c82333);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #218838);
}

.btn-outline {
    background: transparent;
    border: 2px solid currentColor;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    color: white;
    background: var(--primary-color);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ===== 卡片 ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    overflow: hidden;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(74, 107, 255, 0.4);
}

.card-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(42, 47, 63, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 1.25rem;
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(16, 18, 37, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.2);
    background: rgba(22, 25, 49, 0.9);
}

.form-control::placeholder {
    color: var(--text-light);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* 浮动标签表单 */
.item {
    position: relative;
    margin-bottom: 1.5rem;
}

.item input,
.item textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(16, 18, 37, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-family: inherit;
    transition: var(--transition);
}

.item label {
    position: absolute;
    top: 0.75rem;
    left: 1rem;
    color: var(--text-light);
    transition: var(--transition);
    pointer-events: none;
    background: var(--card-bg);
    padding: 0 0.5rem;
}

.item input:focus ~ label,
.item input:not(:placeholder-shown) ~ label,
.item textarea:focus ~ label,
.item textarea:not(:placeholder-shown) ~ label {
    top: -0.5rem;
    left: 0.8rem;
    font-size: 0.75rem;
    color: var(--primary-color);
}

/* ===== 帖子样式 ===== */
.post-item {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.post-item:last-child {
    border-bottom: none;
}

.post-item:hover {
    background: rgba(38, 50, 72, 0.3);
    transform: translateX(5px);
}

.post-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.post-title a {
    color: white;
    transition: var(--transition);
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-content {
    color: var(--text-light);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== 回复样式 ===== */
.answer-item {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.answer-item:last-child {
    border-bottom: none;
}

.answer-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.answer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    margin-right: 1rem;
    flex-shrink: 0;
}

.answer-author {
    font-weight: 600;
}

.answer-time {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-left: auto;
}

.answer-content {
    line-height: 1.7;
    color: var(--text-color);
}

/* ===== 登录/注册表单 ===== */
.loginBox {
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
}

.loginBox .header {
    text-align: center;
    margin-bottom: 2rem;
}

.loginBox .header h2 {
    margin-bottom: 0.5rem;
}

/* ===== 页脚 ===== */
.footer {
    background: rgba(16, 18, 37, 0.8);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 2rem 0;
    margin-top: auto;
    backdrop-filter: blur(8px);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 2rem 0;
    padding: 0;
    gap: 0.5rem;
}

.pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    background: var(--card-bg);
    color: var(--text-color);
    transition: var(--transition);
}

.pagination a:hover,
.pagination a.active {
    background: var(--primary-color);
    color: white;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .main-container {
        padding: 0 1rem;
    }

    .navbar {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .navbar-nav {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .loginBox {
        margin: 3rem auto;
        width: 90%;
    }

    .post-meta {
        gap: 1rem;
    }
}

/* ===== 动画 ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}
/* 导航栏用户欢迎样式 */
.navbar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
}

.navbar-nav .nav-link i {
    font-size: 1rem;
}




